package com.woniu.service;

import com.woniu.been.entity.Courses;
import com.woniu.been.entity.UserOrders;
import com.woniu.been.entity.vo.UserOrdersVo;
import com.woniu.utils.PageResult;
import org.apache.ibatis.annotations.Delete;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service;

import java.util.List;

public interface UserOrdersService{

    List<UserOrders> findAll(UserOrders userOrders);
    String insertOrder(UserOrders userOrders);
    /** 修改订单*/
    int updateById(UserOrders userOrders);
    /** 删除订单*/
    void delById(String order_id);
    /** 批量删除*/
    void deleteBacthed(String ids);

    /** 用户支付订单*/
    String payOrder(UserOrders userOrders);


    PageResult QueryOrdersByPagination(UserOrdersVo userOrdersVo, Integer pageNum, Integer pageSize);
    List<UserOrders> findOrderByNumber(String orderNumber);

    void updateByNumber(String orderNumber);

    UserOrders findNumberByCourseId(Integer courseId,Integer userId);

    Double averageOrderPrice();

    Double totalSales();

    Integer totalOrders();

    List<Courses> courseSalesRanking();

    List<Courses> courseSalesRankingByIncome();

}
